package com.example.distributeid.dao;

import com.example.distributeid.entity.SeqEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ProductDao {

    @Insert("insert into product (id, name) values (#{id}, #{name})")
    void insertProduct(String id, String name);

    @Insert("replace into seq_id (biz) values (#{biz})")
    void generateLatestId(SeqEntity seqEntity);

    @Select("select id from seq_id where biz = #{name}")
    Long getLatestId(String name);
}